/**
 */
package de.thwildau.tm.moses.asn1.asn1.impl;

import de.thwildau.tm.moses.asn1.asn1.Asn1Package;
import de.thwildau.tm.moses.asn1.asn1.ExtensionAddition;
import de.thwildau.tm.moses.asn1.asn1.ExtensionAdditions;

import java.util.Collection;

import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;

import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Extension Additions</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link de.thwildau.tm.moses.asn1.asn1.impl.ExtensionAdditionsImpl#getExtensionAdditions <em>Extension Additions</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class ExtensionAdditionsImpl extends MinimalEObjectImpl.Container implements ExtensionAdditions
{
  /**
   * The cached value of the '{@link #getExtensionAdditions() <em>Extension Additions</em>}' containment reference list.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getExtensionAdditions()
   * @generated
   * @ordered
   */
  protected EList<ExtensionAddition> extensionAdditions;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected ExtensionAdditionsImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  protected EClass eStaticClass()
  {
    return Asn1Package.Literals.EXTENSION_ADDITIONS;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EList<ExtensionAddition> getExtensionAdditions()
  {
    if (extensionAdditions == null)
    {
      extensionAdditions = new EObjectContainmentEList<ExtensionAddition>(ExtensionAddition.class, this, Asn1Package.EXTENSION_ADDITIONS__EXTENSION_ADDITIONS);
    }
    return extensionAdditions;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
  {
    switch (featureID)
    {
      case Asn1Package.EXTENSION_ADDITIONS__EXTENSION_ADDITIONS:
        return ((InternalEList<?>)getExtensionAdditions()).basicRemove(otherEnd, msgs);
    }
    return super.eInverseRemove(otherEnd, featureID, msgs);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case Asn1Package.EXTENSION_ADDITIONS__EXTENSION_ADDITIONS:
        return getExtensionAdditions();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @SuppressWarnings("unchecked")
  @Override
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
      case Asn1Package.EXTENSION_ADDITIONS__EXTENSION_ADDITIONS:
        getExtensionAdditions().clear();
        getExtensionAdditions().addAll((Collection<? extends ExtensionAddition>)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case Asn1Package.EXTENSION_ADDITIONS__EXTENSION_ADDITIONS:
        getExtensionAdditions().clear();
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case Asn1Package.EXTENSION_ADDITIONS__EXTENSION_ADDITIONS:
        return extensionAdditions != null && !extensionAdditions.isEmpty();
    }
    return super.eIsSet(featureID);
  }

} //ExtensionAdditionsImpl
